package test;

import com.itheima.mapper.CheckItemMapper;
import com.itheima.mapper.OrderSettingMapper;
import com.itheima.mapper.UserMapper;
import com.itheima.pojo.CheckItem;
import com.itheima.pojo.OrderSetting2;
import com.itheima.service.impl.OrderSettingServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * 检查项的测试类
 *
 * @description:
 * @author: wangjingliang
 * @create: 2019-11-06 20:01
 **/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring-dao.xml"})
public class CheckItemTest01 {
    @Autowired
    private CheckItemMapper checkItemMapper;
    @Autowired
    private OrderSettingMapper orderSettingMapper;

    //@Test
    public void test01() {
        String name = "二";
        Example example = new Example(CheckItem.class);
        Example.Criteria criteria = example.createCriteria();

        criteria.andLike("name", name);
        List<CheckItem> checkItems = checkItemMapper.selectByExample(example);
        for (CheckItem checkItem : checkItems) {
            System.out.println(checkItem);
        }

    }

    /**
     * 查询所有
     *
     * @param: a
     * @return: null
     * @date: 2019/11/11
     */
   //@Test
    public void test02() {
        List<CheckItem> checkItems = checkItemMapper.selectAll();
        for (CheckItem checkItem : checkItems) {
            System.out.println(checkItem);
        }
    }

    /**
     * 根据主键查询
     *
     * @param:
     * @return: null
     * @date: 2019/11/11
     */
   // @Test
    public void test03() {
        CheckItem checkItem = checkItemMapper.selectByPrimaryKey(28);
        System.out.println(checkItem);
    }
    /**
     * 根据年月查询信息02
     *
     * @param:
     * @return: null
     * @date: 2019/11/17
     */
    //@Test
    public void findByorderDate2(){

    }
}

